function getTime() {  
    var now = new Date();  
    var hours = now.getHours();  
    var minutes = now.getMinutes();  
    var seconds = now.getSeconds(); 
    if (hours < 10) {  
        hours = "0" + hours;  
    } 
    if (minutes < 10) {  
        minutes = "0" + minutes;  
    }
    if (seconds < 10) {  
        seconds = "0" + seconds;  
    }
    return [hours, minutes, seconds];
}

function getWeekday() {  
    var now = new Date();  
    var weekday = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];  
    return weekday[now.getDay()];  
}   

function getDate(type) {  
    var now = new Date();  
    var year = now.getFullYear();  
    var month = now.getMonth() + 1;  
    var date = now.getDate();  
    if (month < 10) {  
      month = "0" + month;  
    }  
    if (type == 'day') {
        return date;
    } else if (type == 'ym') {
        return year + "年" + month + "月"
    }
    if (date < 10) { 
        date = "0" + date;
    }
    return year + "年" + month + "月" + date + "日";  
}
   